<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>产品车辆信息</title>
    <th:block th:include="statics/common/page/header"></th:block>
</head>
<body>
<div id="rrapp" v-cloak>
	<div v-show="showList">
        <Row class="search-panel-space">
            <div class="search-group">
                <i-col span="5">
                	<label class="search-label-20">品牌:</label>
                    <i-input v-model="q.carSerie" @on-enter="query" placeholder="品牌" class="search-item-width-75"/>
                </i-col>
                <i-col span="5">
                    <label class="search-label-20">车型:</label>
                    <i-input v-model="q.carModel" @on-enter="query" placeholder="车型" class="search-item-width-75"/>
                </i-col>
                <i-col span="5">
                    <label class="search-label-20">款式:</label>
                    <i-input v-model="q.design" @on-enter="query" placeholder="款式" class="search-item-width-75"/>
                </i-col>
                <i-col span="5">
                    <label class="search-label-20">配置:</label>
                    <i-input v-model="q.config" @on-enter="query" placeholder="配置" class="search-item-width-75"/>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
        </Row>
        <Row class="search-panel-space">
            <i-col span="5">
                <label class="search-label-20">外观:</label>
                <i-input v-model="q.colour" @on-enter="query" placeholder="外观" class="search-item-width-75"/>
            </i-col>
            <i-col span="5">
                <label class="search-label-20">排量:</label>
                <i-input v-model="q.displacement" @on-enter="query" placeholder="排量" class="search-item-width-75"/>
            </i-col>
            <i-col span="5">
                <label class="search-label-20">变速箱:</label>
                <i-input v-model="q.speedBox" @on-enter="query" placeholder="变速箱" class="search-item-width-75"/>
            </i-col>
            <i-col span="5">
                <label class="search-label-20">动力:</label>
                <i-input v-model="q.power" @on-enter="query" placeholder="动力" class="search-item-width-75"/>
            </i-col>
            <i-col span="5">
                <label class="search-label-20">编码:</label>
                <i-input v-model="q.code" @on-enter="query" placeholder="编码" class="search-item-width-75"/>
            </i-col>
        </Row>
        <Row :gutter="16">
            <div class="buttons-group">
                <i-button type="info" @click="add" th:if="${@shiroAuthService.hasPermission('productcar:save')}">
                	<i class="fa fa-plus"></i>&nbsp;新增</i-button>
                <i-button type="warning" @click="update" th:if="${@shiroAuthService.hasPermission('productcar:update')}">
                	<i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                <i-button type="warning" @click="discountset" th:if="${@shiroAuthService.hasPermission('productcar:discount')}">
                	<i class="fa fa-pencil-square-o"></i>&nbsp;返利设置</i-button>
                <i-button type="warning" @click="royaltyset" th:if="${@shiroAuthService.hasPermission('productcar:royalty')}">
                	<i class="fa fa-pencil-square-o"></i>&nbsp;提成设置</i-button>
                <i-button type="error" @click="del" th:if="${@shiroAuthService.hasPermission('productcar:delete')}">
                	<i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                <i-button type="info" @click="showImport" th:if="${@shiroAuthService.hasPermission('productcar:import')}">
                	<i class="fa fa-plus"></i>&nbsp;导入</i-button>
            </div>
        </Row>
	    <table id="jqGrid"></table>
    </div>

    <Card v-show="showDetail">
        <p slot="title">{{title}}</p>
		<i-form ref="formValidate" :model="productCar" :rules="ruleValidate" :label-width="80">
			<Form-item label="代码" prop="code">
                <i-input v-model="productCar.code" placeholder="代码"/>
            </Form-item>
            <!-- <Form-item label="所属分类" prop="classifyId" style="width:50%;">
                <i-input type="text" v-model="productCar.classifyName" icon="eye" readonly="readonly"
                         @on-click="productClassifyTree" placeholder="所属分类"/>
            </Form-item> -->
            <Form-item label="车辆类型" prop="carType">
                <i-input v-model="productCar.carType" placeholder="车辆类型（SUV，皮卡，轿车,新能源...）"/>
            </Form-item>
            <Form-item label="品牌" prop="carSerie">
                <i-input v-model="productCar.carSerie" placeholder="品牌"/>
            </Form-item>
            <Form-item label="车型" prop="carModel">
                <i-input v-model="productCar.carModel" placeholder="车型"/>
            </Form-item>
            <Form-item label="款式" prop="design">
                <i-input v-model="productCar.design" placeholder="款式"/>
            </Form-item>
            <Form-item label="配置" prop="config">
                <i-input v-model="productCar.config" placeholder="配置"/>
            </Form-item>
            <Form-item label="颜色" prop="colour">
                <i-input v-model="productCar.colour" placeholder="颜色（外观）"/>
            </Form-item>
            <Form-item label="排量" prop="displacement">
                <i-input v-model="productCar.displacement" placeholder="排量"/>
            </Form-item>
            <Form-item label="变速箱" prop="speedBox">
                <i-input v-model="productCar.speedBox" placeholder="变速箱"/>
            </Form-item>
            <Form-item label="动力" prop="power">
                <i-input v-model="productCar.power" placeholder="动力"/>
            </Form-item>
            <Form-item label="备注" prop="content" >
                <i-input type="textarea" v-model="productCar.content" placeholder="备注"/>
            </Form-item>
            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>
                <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
	</Card>
    <Card v-show="showDiscount">
        <p slot="title">{{title}}</p>
		<i-form ref="formDiscountValidate" :model="productDiscount" :label-width="80" th:utext="${@baseProfitItem.hasDiscountItems()}">
        </i-form>
	</Card>
    <Card v-show="showRoyalty">
        <p slot="title">{{title}}</p>
		<i-form ref="formRoyaltyValidate" :model="productRoyalty" :label-width="80" th:utext="${@baseProfitItem.hasRoyaltyItems(0)}">
        </i-form>
	</Card>
	<Modal title="车型导入" v-model="modalImport" class-name="vertical-center-modal" footer-hide="true">
        <i-form>
            <Row>
                <Upload multiple type="drag" action="../product/car/import" :on-success="impsuccess" :on-error="imperror">
                    <div style="padding: 20px 0">
                        <Icon type="ios-cloud-upload" size="52" style="color: #3399ff"></Icon>
                        <p>点击或拖拽文件上传</p>
                    </div>
                </Upload>
            </Row>

            <Form-item>
                <i-button id="success" type="warning" @click="reloadImport" style="float:right;margin-left: 8px;"/>返回</i-button>
                <i-button type="info" @click="downFile" style="float:right;">模板下载</i-button>
            </Form-item>
        </i-form>
    </Modal>
</div>
<div id="productClassifyLayer" style="display: none;padding:10px;">
    <ul id="productClassifyTree" class="ztree"></ul>
</div>
<script th:src="@{../statics/js/product/productcar.js}"></script>
</body>
</html>